﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DCTAccess.Business.News
{
    public class News
    {
        private int _productID = -1;
        private string _title = string.Empty;
        private string _images = string.Empty;
        private int _unitPrice = -1;
        private string _chuyenmuc = string.Empty;
        private string _nhucau = string.Empty;
        private string _chungloai = string.Empty;
        private string _noirao = string.Empty;
        private string _quanhuyen = string.Empty;
        private string _noidung = string.Empty;
        private int _createBy = -1;

        public int CreateBy
        {
            get { return _createBy; }
            set { _createBy = value; }
        }
        #region Property
        public int ProductID
        {
            get { return _productID; }
            set { _productID = value; }
        }

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }


        public string Images
        {
            get { return _images; }
            set { _images = value; }
        }


        public int UnitPrice
        {
            get { return _unitPrice; }
            set { _unitPrice = value; }
        }

        public string Chuyenmuc
        {
            get { return _chuyenmuc; }
            set { _chuyenmuc = value; }
        }


        public string Nhucau
        {
            get { return _nhucau; }
            set { _nhucau = value; }
        }


        public string Chungloai
        {
            get { return _chungloai; }
            set { _chungloai = value; }
        }


        public string Noirao
        {
            get { return _noirao; }
            set { _noirao = value; }
        }


        public string Quanhuyen
        {
            get { return _quanhuyen; }
            set { _quanhuyen = value; }
        }


        public string Noidung
        {
            get { return _noidung; }
            set { _noidung = value; }
        }
        #endregion

        public News() { }

        public News(DataRow newRows)
        {
            this.ProductID = Convert.ToInt32(newRows["ProductID"].ToString());
            this.Title = newRows["ProductName"].ToString();
            this.Images = newRows["ProductImage"].ToString();
            this.UnitPrice = Convert.ToInt32(newRows["Price"].ToString());
            //this.Chuyenmuc = newRows["???"].ToString();
            //this.Nhucau = newRows["???"].ToString();
            //this.Chungloai = newRows["???"].ToString();
            //this.Noirao = newRows["???"].ToString();
            //this.Quanhuyen = newRows["???"].ToString();
            this.Noidung= newRows["ProductContent"].ToString();                     
        }
    }
}
